VB Webbrowserؼ_.Net_Asp.net_վ 
      վҳҳҳͼζվ칫ϵͳݿ缼֤ԷϺڿ͹鼮̳̳̽
       Asp.netAsp.netϵн̳Asp.netʵ̳.Net¼ղ 
        վͼ 
        鼮̳ 
        Աע 


 
 DIY >> վ >> Asp.net >> .Net >> VB 
Webbrowserؼhttp://www.diybl.com/2008-2-19 硡: [  ]
-
-
     ¡  
վͨQQȺ 
¼ݣ
ύform1 
Private Sub Command1_Click() 
WebBrowser1.Document.Forms("form1").submit 
End Sub 

form1еΪuΪã 
Private Sub Command2_Click() 
WebBrowser1.Document.Forms("form1").u.setAttribute "disabled", "disabled" 
End Sub
form1еΪuTextеΪabc 
Private Sub Command2_Click() 
WebBrowser1.Document.Forms("form1").u.setAttribute "value", "abc" 
End Sub
 
1Ϣ 
Private Sub Command1_Click() 
WebBrowser1.Navigate "http://www.applevb.com" 
End Sub 
Private Sub Command2_Click() 
Dim oWindow 
Dim oNav 
Set oWindow = WebBrowser1.Document.parentWindow 
Set oNav = oWindow.navigator 
Debug.Print oNav.userAgent 
Set oWindow = Nothing 
Set oNav = Nothing 
End Sub 
Command1ҳCommand2Ϣ 

2WebbrowserϢ 

Dim oWindow 
Set oWindow = WebBrowser1.Document.parentWindow 
oWindow.confirm "abcd" 

VBwebbrowserɼ2 

WebbrowserдHTMLݵļַ 

Form_Loadм 

WebBrowser1.Navigate "about:blank" 

ȷWebbrowser1 


1 

Dim s As String 
Dim stream As IStream 

s = "" 
s = s + "" 
s = s + "" 
s = s + " 

hello world 

" 
s = s + "" 
s = s + " 
WebBrowser1.Document.Write s 


2 

Dim o 

Set o = WebBrowser1.Document.selection.createrange 
Debug.Print o 
If (Not o Is Nothing) Then 
o.pasteHTML "" 
Set o = Nothing 
End If 


3 

''ı 
Dim o 

Set o = WebBrowser1.Document.selection.createrange 

o.execCommand "InsertTextArea", False, "xxx" 

vbWebbrowserɼ3 
1ҳ 

Private Sub Command2_Click() 
WebBrowser1.Document.parentwindow.scrollby 0, 30 
End Sub 

Private Sub Form_Load() 
WebBrowser1.Navigate "http://www.applevb.com" 
End Sub 


Command2Ϳʹǰҳ¹30 


2жҳǷǰ 

Private Sub Command1_Click() 
WebBrowser1.GoForward 
End Sub 

Private Sub Command2_Click() 
WebBrowser1.GoBack 
End Sub 

Private Sub Form_Load() 
WebBrowser1.Navigate "http://www.applevb.com" 
End Sub 

Private Sub WebBrowser1_CommandStateChange(ByVal Command As Long, ByVal Enable 
As Boolean) 
If (Command = CSC_NAVIGATEBACK) Then 
Command2.Enabled = Enable 
End If 
If (Command = CSC_NAVIGATEFORWARD) Then 
Command1.Enabled = Enable 
End If 
End Sub 

VBwebbrowserɼ4 

1ʹҳֹ 

Private Sub mnuScroll1_Click() 
@#ע⣺ҳȫʾ֮ſ 
WebBrowser1.Document.body.Scroll = "no" @#ʾİ취 
End Sub 
Private Sub mnuScroll2_Click() 
@#ע⣺ҳȫʾ֮ſ 
WebBrowser1.Document.body.Scroll = "Auto" @#ʾİ취 
End Sub 

2λҳбѡвֵHTML 

Private Sub Command1_Click() 
Dim objSelection 
Dim objTxtRange 

Set objSelection = WebBrowser1.Document.selection 
If Not (objSelection Is Nothing) Then 
Set objTxtRange = objSelection.createRange 
If Not (objTxtRange Is Nothing) Then 
Debug.Print objTxtRange.htmlText 

Set objTxtRange = Nothing 
End If 
Set objSelection = Nothing 
End If 
End Sub 

Private Sub Form_Load() 
WebBrowser1.Navigate "http://www.applevb.com" 
End Sub 

Navigate       ʽ Ϊ 

WebBrowser   .Navigate URL 
[Flags,][TargetFrameName,][PostData,][Headers] 

---- WebBrowser   ֧    Ҫ   : 

GoBack        һ  
GoForward        һ  
GoHome     ҡ     ҳ 
Stop    ͣ ֹ   
Refresh    ˢ ¡ 
Navigate      

---- WebBrowser     Ӧ   : 

---- BeforeNavigate        ʼ   ǰ   һ     ȡ   URL    

---- WebBrowser     Ҫ   : 

---- URL           ׼URL     磺   www.MicroSoft.Com     
Ϊhttp://www.MicroSoft.Com.URL Uniform Resource Locator   д  Internet 
WWW        ָ   Ϣ λ    ʾ  

ʹWebBrowserNavigatorNavigator2һaspĵҴ 

ȥaspĵ޷òʲôԭ 

vbԴ룺 
Private Sub cmdSubmit_Click() 
Dim strURL As String, strFormData As String 
Dim strData As String 
strURL = Trim$(txtURL.Text) 
strFormData = "name=" & Trim$(txtName.Text) & 

"&password=" & Trim$(txtPassword.Text) 
Call WBTest.Navigate2(strURL, 64, "_blank", strFormData, 

"hello") 
End Sub 

aspԴ룺 

<%@ Language=VBScript %> 
<% 
dim strName 
dim strPassword 
strName=Trim(Request.Form("name")) 
strPassword=Trim(Request.Form("password")) 
Response.Write(strName) 
Response.Write(strPassword) 
if strName="KingZhang" and strPassword="123456" then 
Response.Write("½ɹ") 
else 
Response.Write("Ƿ½û") 
end if 

%> 

*************
-
:DIY http://www.diybl.com (վ) ¡
[1] [2] [3]
ͼƬҳ治ʾվ    
ղشҳĿҳ桿ۡضرա 
һƪ£AjaxProʵ
һƪ£.Net Treeview Checkboxes

      Ƽ
      Visual CɾעеעϢ
      Serv-Uİװͻ
      eco¼󽫼¼ָλ¼
      Spring.Net IoC+Observerģʽ
      .NETʼ
      ExtJs WebService Jsonл(չJavaScriptSerializer)
      TreeViewĶͼִκ¼jsҵTreeViewڵvalueֵ
      ASP.NETһŲʺվԱյİ˸DOS
      Kaspersky 7.0ϵͳ
      ASP.NETϴļС
      c#дĴͨѶ
      WinFormTextBoxļ
      DataSet.ReadXmlȡSchemeXMLٷ
      ҽ
      C# web شļ


ǳ:   עԱ Ա½ 
 Լchm̳  ֤:              
        ƼDLLʹTreeViewؼ޼2008űPowerShell߼Event 7⼰China 
        earthquake contributionsWritten 
        proposalWinFormDataGridViewؼĿճvncserver for .netC#ADO 
        ݿɼ򵥲VS 2008 .NET 3.5 Beta2Ľ
  

        ΢TomTomͱ Դױ NovellVMwareչ㷺 HPSunһ 
        Solarisϵͳ ƻǲ˹Խ6µƴȨ ȸйԭϯսԹٹȥóB2C˾ ִὫСҵṩ΢ 

ؽ̳
        ̴߳͹ܱдݰԼContainer.DataItem󶨼ҵ д첽صı༭ 
        滻ġȫ滻ܵʵִ Visual Basic 2005 дEXCEL  
        EMTSoftٷİӿڳԱʵ֣2ӿASP.NETʹùܵģͣPipleLinesHTTPparams ÷ 
        򵥸ҪASP.NETʵͼֻAjaxProʵVB Webbrowserؼ.Net Treeview CheckboxesVB 
        Ѵ򿪵MDIӴ.NETеһЩСѧϰC#ļʾ....EXCEL(C#) 
        DELPHIܵĺ̵߳ø̵߳EXCEL㹫ʽ֮excelļSheetĺϲ㹫ʽWindows 
        ؼĲDateTime СC#WinForm̴߳

ĿŽ̳
        asp.net2.0صPetShop 4Windows 
        APIһһ(45)CreateEventSetEventiTextSharp ʹ 
        Ŀоwow2.4汾Web.config΢Expression Studio 2 ʽءתGridView 
        72:¶WINDOWS̴ȫ.net
Ƶͼ
Asp.net
Asp.netϵн̳
Asp.netʵ̳
.Net
ASP
Asp.net
VBScript
Jsp
php
XML
CGI-Perl

ajaxDIY԰塡QQ258622672emaildiybl@163.comӭָ

DIY | About DIY | ϵ | ϵ | ղرվ |  | վͼ | Աע | վҳ

վ¾ΪϴзǷϵǣǻڵһʱɾ

վƸ༭һϵ绰:15009259087 ϵqq 258622672 

ICP06011157šDIY Ȩ 